package com.gry.mystring;

public class String9 {
    public static void main(String[] args) {
        String s1 = "abcde";
        String s2 = "cdeab";
        boolean result = check(s1, s2);
        System.out.println(result);
    }
    public static boolean check(String s1, String s2){
        for (int i = 0; i < s1.length(); i++) {
            s1 = rotete(s1);
            if (s1.equals(s2)){
                return true;
            }
        }
        return false;
    }

    public static String rotete(String s1){
            char c = s1.charAt(0);
            String sub = s1.substring(1);
            return sub+c;


    }

}
